541982cb258bb6a9e853fba70df3ba48b67f0a60,clc/modules/cluster-manager/src/main/java/com/eucalyptus/sla/NodeResourceAllocator.java,NodeResourceAllocator,doPrivilegedLookup,#String#String#,37
Before Change
// } );
// }
// } );
List<Cluster> authorizedClusters = Lists.newArrayList( Clusters.getInstance( ).listValues( ) );
NavigableMap<VmTypeAvailability, Cluster> sorted = Maps.newTreeMap( );
for ( Cluster c : authorizedClusters ) {
sorted.put( c.getNodeState( ).getAvailability( vmTypeName ), c );
After Change
}
}
} else {
Iterable<Cluster> authorizedClusters = Iterables.filter( Clusters.getInstance( ).listValues( ), new Predicate<Cluster>( ) {
@Override
public boolean apply( final Cluster c ) {
return Iterables.any( Contexts.lookup( ).getAuthorizations( ), new Predicate<Authorization>( ) {
@Override
public boolean apply( Authorization arg0 ) {
return arg0.check( c );
}
} );
}
} );
NavigableMap<VmTypeAvailability, Cluster> sorted = Maps.newTreeMap( );
for ( Cluster c : authorizedClusters ) {
sorted.put( c.getNodeState( ).getAvailability( vmTypeName ), c );